package pl.skubicha.response;

import java.io.Serializable;
import java.math.BigDecimal;

import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Digits;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.apache.commons.lang.builder.ReflectionToStringBuilder;

import pl.skubicha.domain.CreditingForm;
import pl.skubicha.domain.Subjects;
import pl.skubicha.domain.Users;
import pl.skubicha.utils.UserSubjectsGroupsSelection;

public class GradesDTO implements Serializable {

	private static final long serialVersionUID = 7694112037043015024L;

	@DecimalMax(value="5.5", message="Ocena nie może być większa niż 5.5")
	@DecimalMin(value="2.0", message="Ocena nie może być mniejsza niż 2.0")
	@Digits(integer=1,fraction=1, message="Format oceny to x.x")
	@NotNull(message="Pole nie może być puste! ")
	private BigDecimal grade;
	
	
	@Size(min=1, message="Pole nie może być puste! ")
	private String date;
	private String comment;

	private Integer id;
	private Subjects subjects;
	private Users users;
	private CreditingForm form;
	
	private UserSubjectsGroupsSelection userSubjectsGroupsSelection;
	
	public GradesDTO() {
		// TODO Auto-generated constructor stub
	}
	
	public GradesDTO( UserSubjectsGroupsSelection userSubjectsGroupsSelection ) {
		this.userSubjectsGroupsSelection = userSubjectsGroupsSelection;
	}

	public BigDecimal getGrade() {
		return grade;
	}

	public void setGrade( final BigDecimal grade ) {
		this.grade = grade;
	}

	public Integer getId() {
		return id;
	}

	public void setId( final Integer id ) {
		this.id = id;
	}

	public Users getUsers() {
		return users;
	}

	public void setUsers( Users users ) {
		this.users = users;
	}

	public Subjects getSubjects() {
		return subjects;
	}

	public void setSubjects( final Subjects subjects ) {
		this.subjects = subjects;
	}

	@Override
	public String toString() {
		return ReflectionToStringBuilder.toString( this );
	}

	public UserSubjectsGroupsSelection getUserSubjectsGroupsSelection() {
		return userSubjectsGroupsSelection;
	}

	public void setUserSubjectsGroupsSelection( UserSubjectsGroupsSelection userSubjectsGroupsSelection ) {
		this.userSubjectsGroupsSelection = userSubjectsGroupsSelection;
	}

	public CreditingForm getForm() {
		return form;
	}

	public void setForm( CreditingForm form ) {
		this.form = form;
	}

	public String getDate() {		
		return this.date;
	}

	public void setDate( String date ) {
		this.date = date;
	}

	public String getComment() {
		return comment;
	}

	public void setComment( String comment ) {
		this.comment = comment;
	}
}